var exec = require('cordova/exec');

module.exports = {


    Type: {
        TEXT:     1,
        FILE:     2,
        IMAGE:    3,
        VIDEO:    4,
        LINK:     5,
        FORWARD:  6,
        MINAPP:   7
    },

    
    /**
     * Share a message to EnterpriseWechat app
     *
     * @example
     * <code>
     * EnterpriseWechat.share({
     *     message: {
     *        title: "Message Title",
     *        description: "Message Description(optional)",
     *        mediaTagName: "Media Tag Name(optional)",
     *        thumb: "http://YOUR_THUMBNAIL_IMAGE",
     *        webpageUrl: "https://gitee.com/zhujin001032/cordova-plugin-enterprise-wechat.git"    // webpage
     *    },
     *    type: EnterpriseWechat.Type.LINK
     * }, function () {
     *     alert("Success");
     * }, function (reason) {
     *     alert("Failed: " + reason);
     * });
     * </code>
     */
    share: function (message, onSuccess, onError) {
        exec(onSuccess, onError, "EnterpriseWechat", "share", [message]);
    },
	 isInstalled: function (onSuccess, onError) {
        exec(onSuccess, onError, "EnterpriseWechat", "isEWXAppInstalled", []);
    },
  
};
